import { IQuery } from "@/interface/IAxios";
import { FormInstance } from "@arco-design/web-vue";

type IUseData<T> = {
  query?: IQuery<T>;
  form?: T;
};
export const useData = <T>(config?: IUseData<T>) => {
  let query = ref<IQuery<T> | undefined>(config?.query);
  const formRef = ref<FormInstance>();
  const form = ref<T | undefined>(config?.form);
  return { query, form, formRef };
};
